var tableColConfig = {
  //投料单审核
  "feedOrder": [{
    "id": "companyOrderId",
    "label": "关联单号"
  }, {
    "id": "factoryId",
    "label": "工厂型号"
  }, {
    "id": "providerNo",
    "label": "供方编号"
  }, {
    "id": "queue",
    "label": "序号"
  }, {
    "id": "materialCode",
    "label": "物料代码"
  }, {
    "id": "providerName",
    "label": "供应商"
  }, {
    "id": "materialName",
    "label": "物料名称"
  }, {
    "id": "color",
    "label": "编号"
  }, {
    "id": "colorDescription",
    "label": "描述"
  }, {
    "id": "model",
    "label": "规格型号"
  }, {
    "id": "unit",
    "label": "单位"
  }, {
    "id": "materialType",
    "label": "物料类型"
  }, {
    "id": "feedCount",
    "label": "计划投料数"
  }, {
    "id": "productionUnitFeedCount",
    "label": "块料占用数"
  }, {
    "id": "count",
    "label": "仓库数量"
  }, {
    "id": "notInCount",
    "label": "未入库数量"
  }, {
    "id": "relationCount",
    "label": "关联数量"
  }, {
    "id": "receiveCount",
    "label": "可领数量"
  }, {
    "id": "purchaseCount",
    "label": "应采购数量"
  }, {
    "id": "createTime",
    "label": "制单时间"
  }, {
    "id": "createUser",
    "label": "制单人"
  }, {
    "label": "单据状态"
  }, {
    "id": "approvalTime",
    "label": "审核时间"
  }, {
    "id": "approvalUser",
    "label": "审核人"
  }],

  //非成品出入库记录
  "warehouseInoutRecord": [{
    "id": "warehouseTypeText",
    "label": "类型"
  }, {
    "id": "inDay",
    "label": "入库日期"
  }, {
    "id": "typeText",
    "label": "来源"
  }, {
    "id": "companyOrderId",
    "label": "订单编号"
  }, {
    "id": "factoryNo",
    "label": "工厂型号"
  }, {
    "id": "customerNo",
    "label": "客户型号"
  }, {
    "id": "customerName",
    "label": "客户名称"
  }, {
    "id": "providerName",
    "label": "供应商"
  }, {
    "id": "materialName",
    "label": "物料名称"
  }, {
    "id": "color",
    "label": "编号"
  }, {
    "id": "colorDescription",
    "label": "描述"
  }, {
    "id": "model",
    "label": "规格"
  }, {
    "id": "materialDeptName",
    "label": "物料部门"
  }, {
    "id": "providerNo",
    "label": "供方编号"
  }, {
    "id": "position",
    "label": "仓位"
  }, {
    "id": "defaultWarehouse",
    "label": "默认仓库"
  }, {
    "id": "inCountPrice",
    "label": "入库单价"
  }, {
    "id": "unitPrice",
    "label": "采购单价"
  }, {
    "id": "inOutUnit",
    "label": "单位"
  }, {
    "id": "purchaseCount",
    "label": "采购数"
  }, {
    "id": "count",
    "label": "数量"
  }, {
    "id": "sumMoneyCount",
    "label": "结算数量"
  }, {
    "id": "scrapCount",
    "label": "报废数量"
  }, {
    "id": "totalMoney",
    "label": "金额"
  }, {
    "id": "selfOutFuCount",
    "label": "交接数"
  }, {
    "id": "status",
    "label": "状态"
  }, {
    "id": "createUser",
    "label": "制单人"
  }, {
    "id": "createTime",
    "label": "制单时间"
  }, {
    "id": "approvalUser",
    "label": "审核人"
  }, {
    "id": "approvalTime",
    "label": "审核时间"
  }, {
    "id": "remark",
    "label": "备注"
  }],

  //成品出入库记录
  "productWarehouseInoutRecord": [{
    "id": "warehouseTypeText",
    "label": "类型"
  }, {
    "id": "typeText",
    "label": "来源"
  }, {
    "id": "companyOrderId",
    "label": "订单编号"
  }, {
    "id": "factoryNo",
    "label": "工厂型号"
  }, {
    "id": "customerNo",
    "label": "客户型号"
  }, {
    "id": "customerName",
    "label": "客户名称"
  }, {
    "id": "colorDescription",
    "label": "描述"
  }, {
    "id": "inCountPrice",
    "label": "单价"
  }, {
    "id": "inOutUnit",
    "label": "单位"
  }, {
    "id": "count",
    "label": "数量"
  }, {
    "id": "totalMoney",
    "label": "金额"
  }, {
    "id": "selfOutFuCount",
    "label": "交接数"
  }, {
    "id": "status",
    "label": "状态"
  }, {
    "id": "createUser",
    "label": "制单人"
  }, {
    "id": "createTime",
    "label": "制单时间"
  }, {
    "id": "approvalUser",
    "label": "审核人"
  }, {
    "id": "approvalTime",
    "label": "审核时间"
  }, {
    "id": "remark",
    "label": "备注"
  }],

  //查询采购单-订单采购
  "purchaseOrder-order": [{
    id: "status",
    label: "状态"
  }, {
    id: "companyOrderId",
    label: "订单编号"
  }, {
    id: "articleNo",
    label: "客户型号"
  }, {
    id: "factoryNo",
    label: "工厂型号"
  }, {
    id: "providerNo",
    label: "供方编号"
  }, {
    id: "providerName",
    label: "供应商"
  }, {
    id: "purchasePeople",
    label: "采购员"
  }, {
    id: "materialName",
    label: "物料名称"
  }, {
    id: "materialType",
    label: "物料类型"
  }, {
    id: "color",
    label: "编号"
  }, {
    id: "colorDescription",
    label: "描述"
  }, {
    id: "model",
    label: "规格型号"
  }, {
    id: "materialDeptName",
    label: "物料部门"
  }, {
    id: "qualityType",
    label: "材质"
  }, {
    id: "unit",
    label: "单位"
  }, {
    id: "price",
    label: "含税单价"
  }, {
    id: "totalMoney",
    label: "金额"
  }, {
    id: "orderTotal",
    label: "订单数"
  }, {
    id: "feedTotal",
    label: "投料数"
  }, {
    id: "purchaseCount",
    label: "采购数量"
  }, {
    id: "inCount",
    label: "入库数量"
  }, {
    id: "inCountDate",
    label: "入库日期"
  }, {
    id: "tax",
    label: "税率"
  }, {
    id: "laterPhaseOne",
    label: "预计收货期"
  }, {
    id: "laterPhaseTwo",
    label: "复期1"
  }, {
    id: "laterPhaseThr",
    label: "复期2"
  }, {
    id: "laterPhaseFour",
    label: "复期3"
  }, {
    id: "purchaseTime",
    label: "采购日期"
  }, {
    id: "isPrint",
    label: "是否打印"
  }, {
    id: "createUser",
    label: "制单人"
  }, {
    id: "createTime",
    label: "制单日期"
  }, {
    id: "approvalUser",
    label: "审核人"
  }, {
    id: "approvalTime",
    label: "审核时间"
  }, {
    id: "feedOrderRemark",
    label: "投料单备注"
  }],

  //查询采购单-库存采购
  "purchaseOrder-warehouse": [{
    id: "status",
    label: "状态"
  }, {
    id: "companyOrderId",
    label: "订单编号"
  }, {
    id: "articleNo",
    label: "客户型号"
  }, {
    id: "factoryNo",
    label: "工厂型号"
  }, {
    id: "providerNo",
    label: "供方编号"
  }, {
    id: "providerName",
    label: "供应商"
  }, {
    id: "purchasePeople",
    label: "采购员"
  }, {
    id: "materialName",
    label: "物料名称"
  }, {
    id: "materialType",
    label: "物料类型"
  }, {
    id: "color",
    label: "编号"
  }, {
    id: "colorDescription",
    label: "描述"
  }, {
    id: "model",
    label: "规格型号"
  }, {
    id: "materialDeptName",
    label: "物料部门"
  }, {
    id: "qualityType",
    label: "材质"
  }, {
    id: "unit",
    label: "单位"
  }, {
    id: "price",
    label: "含税单价"
  }, {
    id: "totalMoney",
    label: "金额"
  }, {
    id: "purchaseCount",
    label: "采购数量"
  }, {
    id: "inCount",
    label: "入库数量"
  }, {
    id: "inCountDate",
    label: "入库日期"
  }, {
    id: "tax",
    label: "税率"
  }, {
    id: "laterPhaseOne",
    label: "预计收货期"
  }, {
    id: "laterPhaseTwo",
    label: "复期1"
  }, {
    id: "laterPhaseThr",
    label: "复期2"
  }, {
    id: "laterPhaseFour",
    label: "复期3"
  }, {
    id: "purchaseTime",
    label: "采购日期"
  }, {
    id: "isPrint",
    label: "是否打印"
  }, {
    id: "createUser",
    label: "制单人"
  }, {
    id: "createTime",
    label: "制单日期"
  }, {
    id: "approvalUser",
    label: "审核人"
  }, {
    id: "approvalTime",
    label: "审核时间"
  }, {
    id: "remark",
    label: "备注"
  }],

  //预采购单
  prePurchaseOrder: [{
    id: "status",
    label: "状态"
  }, {
    id: "companyOrderId",
    label: "订单编号"
  }, {
    id: "articleNo",
    label: "客户型号"
  }, {
    id: "factoryNo",
    label: "工厂型号"
  }, {
    id: "providerName",
    label: "供应商"
  }, {
    id: "purchasePeople",
    label: "采购员"
  }, {
    id: "materialName",
    label: "物料名称"
  }, {
    id: "materialType",
    label: "物料类型"
  }, {
    id: "color",
    label: "编号"
  }, {
    id: "colorDescription",
    label: "描述"
  }, {
    id: "purchaseCount",
    label: "采购数量"
  }, {
    id: "model",
    label: "规格型号"
  }, {
    id: "qualityType",
    label: "材质"
  }, {
    id: "unit",
    label: "单位"
  }, {
    id: "price",
    label: "含税单价"
  }, {
    id: "totalMoney",
    label: "金额"
  }, {
    id: "tax",
    label: "税率"
  }, {
    id: "defaultWarehouse",
    label: "仓库"
  }, {
    id: "laterPhaseOne",
    label: "预计收货期"
  }, {
    id: "laterPhaseTwo",
    label: "复期1"
  }, {
    id: "laterPhaseThr",
    label: "复期2"
  }, {
    id: "laterPhaseFour",
    label: "复期3"
  }, {
    id: "createUser",
    label: "制单人"
  }, {
    id: "createTime",
    label: "制单日期"
  }, {
    id: "approvalUser",
    label: "审核人"
  }, {
    id: "approvalTime",
    label: "审核时间"
  }],

  //采购单入库
  purchaseinWarehouseMaterial: [{
    id: "type",
    label: "采购类型"
  }, {
    id: "purchaseId",
    label: "采购单号"
  }, {
    id: "companyOrderId",
    label: "订单编号"
  }, {
    id: "factoryNo",
    label: "工厂型号"
  }, {
    id: "coustomId",
    label: "客户型号"
  }, {
    id: "providerName",
    label: "供应商"
  }, {
    id: "materialName",
    label: "物料名称"
  }, {
    id: "materialType",
    label: "物料类型"
  }, {
    id: "color",
    label: "编号"
  }, {
    id: "colorDescription",
    label: "描述"
  }, {
    id: "model",
    label: "规格"
  }, {
    id: "materialDeptName",
    label: "物料部门"
  }, {
    id: "providerNo",
    label: "供方编号"
  }, {
    id: "unit",
    label: "采购单位"
  }, {
    id: "unitPrice",
    label: "采购单价"
  }, {
    id: "purchaseCount",
    label: "采购数量"
  }, {
    id: "countb",
    label: "已入数量"
  }],

  //仓库物料统计
  materialStockStat: [{
    id: "providerName",
    label: "供应商"
  }, {
    id: "materialName",
    label: "物料名称"
  }, {
    id: "model",
    label: "规格"
  }, {
    id: "color",
    label: "编号"
  }, {
    id: "materialDeptName",
    label: "物料部门"
  }, {
    id: "defaultWarehouse",
    label: "仓库"
  }, {
    id: "count",
    label: "库存数"
  }, {
    id: "materialUseCount",
    label: "占用数"
  }, {
    id: "unitPrice",
    label: "物料单价"
  }, {
    id: "productionUnitCount",
    label: "生产库存数"
  }, {
    id: "sumPrice",
    label: "总价"
  }],

  //应付账款-材料应付
  inMaterialBalance: [{
    id: "type",
    label: "入库类型"
  }, {
    id: "purchaseId",
    label: "采购单号"
  }, {
    id: "orderId",
    label: "订单编号"
  }, {
    id: "factoryNo",
    label: "工厂型号"
  }, {
    id: "coustomId",
    label: "客户型号"
  }, {
    id: "providerName",
    label: "供应商"
  }, {
    id: "materialName",
    label: "物料名称"
  }, {
    id: "materialType",
    label: "物料类型"
  }, {
    id: "model",
    label: "规格型号"
  }, {
    id: "color",
    label: "编号"
  }, {
    id: "colorDescription",
    label: "描述"
  }, {
    id: "defaultWarehouse",
    label: "默认仓位"
  }, {
    id: "materialDeptName",
    label: "物料部门"
  }, {
    id: "inCountUnit",
    label: "入库单位"
  }, {
    id: "inCountPrice",
    label: "入库单价"
  }, {
    id: "unitPrice",
    label: "采购单价"
  }, {
    id: "count",
    label: "数量"
  }, {
    id: "totalPrice",
    label: "入库金额"
  }, {
    id: "receiptPaymentPrice",
    label: "已付金额"
  }, {
    id: "addReducePrice",
    label: "增减金额"
  }, {
    id: "isTax",
    label: "是否含税"
  }, {
    id: "isBalance",
    label: "是否结算"
  }, {
    id: "money",
    label: "结算金额"
  }, {
    id: "payTime",
    label: "预计结算日期"
  }, {
    id: "inCountTime",
    label: "下单时间"
  }, {
    id: "purchaseTime",
    label: "采购时间"
  }, {
    id: "inDay",
    label: "入库日期"
  }, {
    id: "balanceTime",
    label: "结算时间"
  }, {
    id: "createUser",
    label: "制单人"
  }],

  //应付账款-外协应付
  inOutOrderBalance: [{
    id: "orderId",
    label: "订单编号"
  }, {
    id: "factoryId",
    label: "工厂型号"
  }, {
    id: "coustomId",
    label: "客户型号"
  }, {
    id: "coustomOrderId",
    label: "客户订单号"
  }, {
    id: "supplierName",
    label: "供应商"
  }, {
    id: "technology",
    label: "加工工艺"
  }, {
    id: "flowCycle",
    label: "流程周期"
  }, {
    id: "maching",
    label: "加工对象"
  }, {
    id: "colorList",
    label: "颜色"
  }, {
    id: "model",
    label: "规格"
  }, {
    id: "count",
    label: "外协数量"
  }, {
    id: "unitPrice",
    label: "单价"
  }, {
    id: "valuationCount",
    label: "计价数量"
  }, {
    id: "totalPrice",
    label: "外协金额"
  }, {
    id: "returnCount",
    label: "完成数量"
  }, {
    id: "returnValuationCount",
    label: "完成计价数量"
  }, {
    id: "returnTotalPrice",
    label: "外协完成金额"
  }, {
    id: "returenTime",
    label: "完成时间"
  }, {
    id: "receiptPaymentPrice",
    label: "已付金额"
  }, {
    id: "addReducePrice",
    label: "增减金额"
  }, {
    id: "isBalance",
    label: "是否结算"
  }, {
    id: "money",
    label: "结算金额"
  }, {
    id: "balanceTime",
    label: "结算时间"
  }, {
    id: "createUser",
    label: "制单人"
  }, {
    id: "createTime",
    label: "制单时间"
  }, {
    id: "remark",
    label: "备注"
  }],

  //应收账款
  outBalance: [{
    id: "id",
    label: "出库单号"
  }, {
    id: "orderId",
    label: "订单编号"
  }, {
    id: "factoryNo",
    label: "工厂型号"
  }, {
    id: "coustomId",
    label: "客户型号"
  }, {
    id: "providerName",
    label: "客户"
  }, {
    id: "materialName",
    label: "物料名称"
  }, {
    id: "materialType",
    label: "物料类型"
  }, {
    id: "model",
    label: "规格型号"
  }, {
    id: "color",
    label: "编号"
  }, {
    id: "colorDescription",
    label: "描述"
  }, {
    id: "defaultWarehouse",
    label: "默认仓位"
  }, {
    id: "materialDeptName",
    label: "物料部门"
  }, {
    id: "inOutUnit",
    label: "出库单位"
  }, {
    id: "outCountPrice",
    label: "出库单价"
  }, {
    id: "count",
    label: "数量"
  }, {
    id: "totalPrice",
    label: "出库金额"
  }, {
    id: "receiptPaymentPrice",
    label: "已收金额"
  }, {
    id: "addReducePrice",
    label: "增减金额"
  }, {
    id: "isTax",
    label: "是否含税"
  }, {
    id: "isBalance",
    label: "是否结算"
  }, {
    id: "money",
    label: "结算金额"
  }, {
    id: "estimatePayTime",
    label: "预计收款日期"
  }, {
    id: "createTime",
    label: "出库时间"
  }, {
    id: "balanceTime",
    label: "结算时间"
  }, {
    id: "createUser",
    label: "制单人"
  }],

  //收付款记录
  inoutPaymentRecord: [{
    id: "receivePaymentId",
    label: "收付款单号"
  }, {
    id: "type",
    label: "类型"
  }, {
    id: "source",
    label: "来源"
  }, {
    id: "sumMoney",
    label: "金额"
  }, {
    id: "conversionPrice",
    label: "折算金额"
  }, {
    id: "receiptPaymentMode",
    label: "收付方式"
  }, {
    id: "customerName",
    label: "收付款方"
  }, {
    id: "relationBank",
    label: "银行卡号"
  }, {
    id: "bank",
    label: "所属银行"
  }, {
    id: "invoicePrice",
    label: "开票金额"
  }, {
    id: "invoiceDate",
    label: "开票日期"
  }, {
    id: "actualDay",
    label: "收付款日期"
  }, {
    id: "status",
    label: "状态"
  }, {
    id: "createUserName",
    label: "制单人"
  }, {
    id: "createTime",
    label: "制单时间"
  }, {
    id: "approvalUserName",
    label: "审核人"
  }, {
    id: "approvalTime",
    label: "审核时间"
  }, {
    id: "isVerification",
    label: "是否核销"
  }, {
    id: "verificationUser",
    label: "核销人"
  }, {
    id: "verificationTime",
    label: "核销时间"
  }, {
    id: "reason",
    label: "备注"
  }],

  //出入库财务汇总
  inoutWarehouseOrder: [{
    id: "typeText",
    label: "类型"
  }, {
    id: "inDay",
    label: "入库日期"
  }, {
    id: "typeText",
    label: "订单编号"
  }, {
    id: "companyOrderId",
    label: "类型"
  }, {
    id: "customerNo",
    label: "客户型号"
  }, {
    id: "customerName",
    label: "客户名称"
  }, {
    id: "factoryNo",
    label: "工厂型号"
  }, {
    id: "typeText",
    label: "类型"
  }, {
    id: "providerName",
    label: "供应商"
  }, {
    id: "materialName",
    label: "物料名称"
  }, {
    id: "model",
    label: "规格"
  }, {
    id: "color",
    label: "编号"
  }, {
    id: "colorDescription",
    label: "描述"
  }, {
    id: "defaultWarehouse",
    label: "默认仓位"
  }, {
    id: "materialDeptName",
    label: "物料部门"
  }, {
    id: "position",
    label: "仓位"
  }, {
    id: "balancePrice",
    label: "单价"
  }, {
    id: "inOutUnit",
    label: "单位"
  }, {
    id: "count",
    label: "数量"
  }, {
    id: "totalMoney",
    label: "金额"
  }, {
    id: "isTax",
    label: "是否含税"
  }, {
    id: "remark",
    label: "备注"
  }, {
    id: "createUser",
    label: "制单人"
  }, {
    id: "createTime",
    label: "制单时间"
  }, {
    id: "approvalUser",
    label: "审核人"
  }, {
    id: "approvalTime",
    label: "审核时间"
  }],

  //订单成本汇总
  orderCostStat: [{
    id: "companyOrderId",
    label: "订单编号"
  }, {
    id: "factoryId",
    label: "工厂型号"
  }, {
    id: "customerId",
    label: "客户型号"
  }, {
    id: "feedTotal",
    label: "订单投料数"
  }, {
    id: "feedCount",
    label: "物料用料数"
  }, {
    id: "orderTotal",
    label: "订单数"
  }, {
    id: "glassesMoney",
    label: "投料成本"
  }, {
    id: "glassesOrderMoney",
    label: "订单成本"
  }, {
    id: "yuCost",
    label: "预计人工"
  }, {
    id: "peopleCost",
    label: "实际人工"
  }, {
    id: "managerCost",
    label: "管理成本"
  }]
};

var tableColConfigUtil = {
  tableNameObj: {
    "purchaseOrder-order": "订单采购单",
    "purchaseOrder-warehouse": "库存采购单"
  },

  getConfig: function (tableName) {
    switch (tableName) {
      case 'purchaseOrder':
        tableName = ["purchaseOrder-order", "purchaseOrder-warehouse"];
        break;
    }

    var config;
    if (_.isArray(tableName)) {
      config = {};
      for (var i = 0; i < tableName.length; i++) {
        var name = tableName[i];
        var columns = tableColConfig[name];
        if (columns === undefined) {
          return null;
        }
        config[name] = columns;
      }
    } else {
      var columns = tableColConfig[tableName];
      if (columns === undefined) {
        return null;
      }
      config = {
        columns: columns
      };
    }
    return config;
  },

  getTableName: function (tableName) {
    var tableNameObj = this.tableNameObj;
    tableName = tableNameObj[tableName];
    if (tableName === undefined) {
      return null;
    }
    return tableName;
  }
};
